<div class="wrapper wrapper-content fadeInRight" ng-controller="roleListCtr">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<h5>角色列表</h5>
				</div>
				
				<div class="ibox-content">
					<div class="row">
						<div class="col-sm-10 pull-left">
							<button class="btn btn-success" access="AccessRoleEdit" ng-click="showEdit()">新增</button>
						</div>
					</div>
				
					<table class="table table-bordered" style="text-align: center;">
						<thead>
							<tr>
								<td>序号</td>
								<td>角色名称</td>
								<td>状态</td>
								<td>创建时间</td>
								<td>操作</td>
							</tr>
						</thead>
						<tbody>
							<tr ng-repeat="item in data.list">
								<td>{{ $index+1 }}</td>
								<td>{{item.name}}</td>
								<td>{{item.status == 1 ? '正常' : '禁用'}}</td>
								<td>{{item.create_time}}</td>
								<td>
									<a class="btn btn-xs btn-primary" access="AccessRoleEdit" ng-click="showEdit(item)">编辑</a>
									<a class="btn btn-xs btn-danger" access="AccessRoleDel" ng-click="del(item)">删除</a>
								</td>
							</tr>
							<tr ng-if="data.list.length == 0">
								<td colspan="6">暂无数据</td>
							</tr>
						</tbody>
					</table>
								
				</div>
			</div>
		</div>
	</div>
	
	<div class="modal fade" id="myModal" tabindex="1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog modal-lg" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title" id="myModalLabel">编辑角色</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal" id="editRoleForm">
						<div class="form-group">
							<label class="col-sm-2 control-label"><span style="color:red;margin-right:5px;">*</span>角色名称</label>
							<div class="col-sm-5">
								<input class="form-control" ng-model="edit.name" name="name" required="required">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"><span style="color:red;margin-right:5px;">*</span>状态</label>
							<div class="col-sm-5">
								<label class="radio-inline">
								  <input type="radio" name="status" ng-model="edit.status" id="inlineRadio1" value="1"> 正常
								</label>
								<label class="radio-inline">
								  <input type="radio" name="status" ng-model="edit.status" id="inlineRadio2" value="0"> 禁用
								</label>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"><span style="color:red;margin-right:5px;">*</span>选择权限节点</label>
							<div class="col-sm-9">
								<div class="tab-content">
									<div id="tab-1" class="tab-pane active">
										<table class="table table-bordered " style="text-align: left;border-top:0;">
											<tr ng-repeat="access in data.access">
												<td style="min-width:110px;" ng-style="{'border-top': $index == 0 ? '0px' : '1px'}">
													<label class="chckbox-inline"><input icheck checkall="access" item-data="access" check-result="edit.access" type="checkbox" value="{{access.id}}" ng-model="access.checked">{{access.name}}</label>
												</td>
												<td ng-style="{'border-top': $index == 0 ? '0px' : '1px'}">
													<label class="chckbox-inline" ng-repeat="children in access.children" style="margin-right:10px;">
														<input type="checkbox" icheck item-data="children" check-result="edit.access" value="{{children.id}}" ng-model="children.checked">{{children.name}}
													</label>
												</td>
											</tr>
										</table>
									</div>
								</div>
								
							</div>
						</div>
						
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary" access="AccessRoleEdit" ng-click="commit()">保存</button>
				</div>
			</div>
		</div>
	</div>
		

	
</div>